/ Assembly List / LJCNetCommon / TextBuilder / GetWrapped

Namespace - LJCNetCommon


Parameters
text - The text value.

Returns

The potentially wrapped and indented new text value.

Syntax

C#
public String GetWrapped(String text)

Gets added text and new wrapped line if combined line > LineLimit.

Example

C#
// Defaults: IndentCharCount = 2, LineLimit = 80, WrapEnabled = false.
var tb = new TextBuilder
{
    WrapEnabled = true,
    WrapPrefix = "",
};

// Example Method:
var b = new TextBuilder();
b.AddText("Now is the time for all good men to come to the aid of their");
b.AddText(" country.");
b.AddText(" Now is the time for all good men to come to the aid of their");
b.AddText(" country.");
var text = b.ToString();
var result = tb.GetWrapped(text);

// result:
// Now is the time for all good men to come to the aid of their country. Now is the
// time for all good men to come to the aid of their country.

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.